-
Notifications
You must be signed in to change notification settings - Fork 8k
drivers/espi: rts5912: handler all port 80 data until fifo is empty #95005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers/espi: rts5912: handler all port 80 data until fifo is empty #95005
Conversation
|
drivers/espi/espi_realtek_rts5912.c
Outdated
espi_send_callbacks(&espi_data->callbacks, dev, evt); | ||
int32_t start_time = k_uptime_get_32(); | ||
|
||
while (!(port80_reg->STS & PORT80_STS_FIFOEM)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As implemented, you are including the time spent in the callback as part of the timeout check. If the callback is slow, this will cause a false timeout. You should exclude the callback time in this calculation.
Also note that it's recommended to use the 64-bit version of k_uptime_get()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. This timeout is designed to prevent the EC from spending excessive time stuck in the ISR. However, it is difficult to reasonably estimate the time required for the callback. Actual testing shows that under normal conditions, the EC retrieves 1 to 3 entries from the FIFO. Even with frequent writes from the host, the maximum count of 16 entries should be sufficient. Therefore, a usage count limit replaces the original time limit.
e8eeda1
to
9778151
Compare
9778151
to
06d2cdc
Compare
The rts5912's port 80 has a FIFO. In the ISR (Interrupt Service Routine), extract the FIFO data until the FIFO is empty, otherwise port 80 data will be lost. Signed-off-by: jhan bo chao <[email protected]>
06d2cdc
to
71429ed
Compare
|
The rts5912's port 80 has a FIFO. In the ISR (Interrupt Service Routine), extract the FIFO data until the FIFO is empty, otherwise port 80 data will be lost.